<?php

require_once('connections/mysqlDB.php');
$dbConn = new mysqli(HOST,USER,PWD,DB);
if (mysqli_connect_errno()) { die('Connect failed: ' . mysqli_connect_error()); }  

$dbConn->query("SET NAMES 'utf8'");

if ($dbConn) {
// Check if conference registration already ends
$stmt1 = $dbConn->query("select datediff(registration_end_date, NOW()) as expire, title, conference_id from conference 
where location = 'San Francisco' order by conference_id desc limit 1; ");
while ($row=$stmt1->fetch_assoc()) {
  $expire = $row["expire"];
  $title = $row["title"];
  $conferenceid = $row["conference_id"];
};
$stmt1->close();
$dbConn->close();
session_register("expire");
session_register("title");
session_register("conferenceID");
$_SESSION['expire'] = $expire;
$_SESSION['conferenceID'] = $conferenceid;
$_SESSION['title']=$title;
}
?>